<!DOCTYPE>
<html>
	<head>
		<meta charset='utf-8'>
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>选择用户</title>
		<style>
			*{
			padding:0;
			margin:0;
		}
			.head{
				width:100%;
			}
			.head img{
				width:100%;
			}
			
			.content{
				display:flex;
				 flex-direction:column;
			}
			.user_input,.button{
				display:flex;
				justify-content:center;
				height:3rem;
				margin-top:2rem;
			}
			.user_input input{
				border-radius:.5rem;
				border:1px solid #bbb;
				width:80%;
				
			}
			.button button{
				width:80%;
				border-radius:.5rem;
				background-color:#fed200;
				border:1px solid #bbb;
			}
		</style>
	</head>
	<body>
		<div class='head'>
			
			<img src='/static/home/img/select.jpg'  usemap="#planetmap">
			<map name="planetmap" id="planetmap">
				 <area shape="rect" coords="100,450,1880,1580" class='planetSelect' onclick='fiveOnesev()' alt="Sun" />
				 <area shape="rect" coords="509,1750,1400,2074" class='planetSelect' onclick='liantong()' alt="Sun" />
				  <area shape="rect" coords="509,2214,1400,2538" class='planetSelect' onclick='otherPeople()' alt="Sun" />
			</map>
		</div>
		<div class='content'>
			<!--<div class='button'>
				<button onclick='liantong()'>联通用户</button>
			</div>
			<div class='button'>
				<button onclick='otherPeople()'>其他用户</button>
			</div>-->
			
		</div>
		<script src="/static/common/js/jquery-2.1.4.min.js"></script>
		<script src='/static/layer-v3.1.1/layer/mobile/layer.js'></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"> </script>
		<script>
			changeCoords();
			function changeCoords(){
				var width = document.body.offsetWidth;
				var height = document.body.offsetHeith;
				if (1920 == width) return;
				var percent = width/1920;
				$(".planetSelect").each(function(){
					var coords = $(this).attr("coords");
					var arr = coords.split(",");
					for(var i=0;i<arr.length;i++){
						arr[i] *= percent;
					}
					var str = arr.join(",");
					$(this).attr("coords",str);
				});
			}
			function liantong(){
				localStorage.setItem("userSelect", "2");//联通用户
				var is_user = {{is_user}};
				if( is_user == 1 ){
					layer.open({
						content: '您已经选择了其他用户'
						,btn: '我知道了'
					  });
					 return;
				}
				
				 var loding = layer.open({
					type: 2
					,content: '加载中'
				  });
				$.ajax({
					url:'/home/setUser',
					type:'post',
					dataType:'json',
					data:{is_user:2},
					success:function( data  ){
						layer.close(loding);
						if( data.code == 0 ){
							window.location.href = '/home/info.html';
						}else{
							//layer.alert(data.message)
							layer.open({
								content: data.message
								,btn: '我知道了'
							  });
						}
					}
					
				})
				
			}
			function otherPeople(){
				localStorage.setItem("userSelect", "1");//其他用户
				var is_user = {{is_user}};
				if( is_user == 2 ){
					layer.open({
						content: '您已经选择了联通用户'
						,btn: '我知道了'
					  });
					 return ;
				}
				
				 var loding = layer.open({
					type: 2
					,content: '加载中'
				  });
				$.ajax({
					url:'/home/setUser',
					type:'post',
					dataType:'json',
					data:{is_user:1},
					success:function( data  ){
						layer.close(loding);
						if( data.code == 0 ){
							window.location.href = '/home/info.html';
						}else{
							//layer.alert(data.message)
							layer.open({
								content: data.message
								,btn: '我知道了'
							  });
						}
					}
					
				})
			}
			function fiveOnesev(){
				window.location.href = "https://m.10010.com/pushpage/69800000320983.36.html?WT.mc_id=zhejiang_zhejiang_517zhengshi_0515_H5_0001&utm_source=zhejiang&utm_medium=cpc&utm_term=&utm_content=jpg&utm_campaign=zhejiang_zhejiang_517zhengshi_0515_H5_0001";
			}
			$(function(){
		wx.config({
			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
			appId: '{{weixin.appID}}', // 必填，公众号的唯一标识
			timestamp: {{weixin.time}}, // 必填，生成签名的时间戳
			nonceStr: '{{weixin.noncestr}}', // 必填，生成签名的随机串
			signature: '{{weixin.signature}}',// 必填，签名，见附录1
			jsApiList: [
				'checkJsApi',
				'onMenuShareTimeline',
				'onMenuShareAppMessage',
			] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		wx.ready(function(){
			// config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
			wx.onMenuShareAppMessage({
				title:'517网购节甩的一手好牌，你要不要', // 分享标题
				link:'http://517.augsky.com', // 分享标题
				imgUrl:'http://517.augsky.com/static/home/img/jiangpin1.jpg',
			success: function () {
				alert(1)
				// 用户点击了分享后执行的回调函数
			}
			});

			wx.onMenuShareTimeline({
title:'517网购节甩的一手好牌，你要不要', // 分享标题
                                link:'http://517.augsky.com', // 分享标题
                                imgUrl:'http://517.augsky.com/static/home/img/jiangpin1.jpg',

			success: function () {
				alert(1)
				// 用户点击了分享后执行的回调函数
			}
			});

		});
	})
		</script>
	</body>
</html>